package com.myproject.weather.activity;

import com.myproject.weather.R;

import android.app.Activity;
import android.graphics.Color;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Bundle;
import android.view.View;
import android.widget.VideoView;

public class TrendActivity extends Activity {
	VideoView video;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.trend);

		View back = findViewById(R.id.trendBackground);
		back.setBackgroundColor(Color.argb(155, 255, 255, 255));

		video = (VideoView) findViewById(R.id.videoView1);
		video.setVideoPath("android.resource://" + getPackageName() + "/" + R.raw.main_bg_2);
		video.setOnCompletionListener(new OnCompletionListener() {

			@Override
			public void onCompletion(MediaPlayer mp) {
				video.start();
			}
		});
	}

	@Override
	protected void onPause() {
		super.onPause();
		video.pause();
	}

	@Override
	protected void onResume() {
		super.onResume();
		video.start();
	}
}
